package com.hlkj.baojin.entity;

import com.hlkj.baojin.entity.dto.AlarmReason;
import com.hlkj.baojin.entity.dto.HandleMethod;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;

/** 报警记录
 * @author 徐其伟
 * @Description:
 * @date 18-12-17 上午9:06
 */
@Document
@Getter
@Setter
public class AlarmRecord implements Serializable {
    @Id
    private String id;
    /**
     * 公司id
     */
    private String companyId;
     /**
     * 设备Id
     */
    private String deviceId;
    /**
     * 报警内容
     */
    private String alarmContent;
    /**
     * 报警状态 0未上报 1上报
     */
    private Integer alarmStatus;
    private AlarmReason alarmReason;
    /**
     * 处理状态 状态 0未上报 1上报
     */
    private Integer handleStatus;

    private HandleMethod handleMethod;

    /**
     * 恢复时间
     */
    private Long recoverTime;

    /**
     * 恢复状态 默认null 1 已恢复
     */
    private Integer recoverStatus;

    private Long createTime;

    private Long updateTime;

    private Integer delete;

    private Integer smsTimes;

    public AlarmRecord() {
    }

    /** 收到报警数据 使用该构造方法即可
     * @param companyId
     * @param deviceId
     * @param alarmContent
     */
    public AlarmRecord(String companyId, String deviceId, String alarmContent,Long time) {
        this.companyId = companyId;
        this.deviceId = deviceId;
        this.alarmContent = alarmContent;
        this.smsTimes = 1;
        this.updateTime=time;
        this.createTime=time;

    }
}
